var express = require('express');
var router = express.Router();

var User = {
  name : "邵晓风",
  course : "高等数学",
  school : "大工软院"
};

function Course(name, lastTime, isChecked, tag, isUploaded) {
  this.name = name;
  this.lastTime = lastTime;
  this.isChecked = isChecked;
  this.tag = tag;
  this.isUploaded = isUploaded;
  this.questions = ["春眠不觉晓的下一句？","How are you的英文翻译？"]
}

var Courses = [
    new Course("语文", new Date(), true, "文科", true),
    new Course("数学", new Date(), false, "理科", false),
    new Course("英语", new Date(), false, "文科", true)
];

router.get('/reg_login', function(req, res, next) {
  res.render('reg_login', {
    user: User,
    courses : Courses
  });
});

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', {
    user: User,
    courses : Courses
  });
});

router.get('/test', function (req, res, next) {
  res.render('test', {
    user: User,
    courses : Courses
  });
});

router.get('/source', function (req, res, next) {
  res.render('source', {
    user: User,
    courses : Courses
  });
});

router.get('/personal', function (req, res, next) {
  res.render('personal', { user: User });
});

router.get('/security', function (req, res, next) {
  res.render('security', { user: User });
});

router.get('/homework_post', function (req, res, next) {
  res.render('homework_post', {
    user: User,
    courses : Courses
  });
});

router.get('/collection', function (req, res, next) {
  res.render('collection', {
    user: User,
    courses : Courses
  });
});

router.get('/chat', function (req, res, next) {
  res.render('chat', {
    user: User,
    courses : Courses
  });
});

router.get('/homework_check', function (req, res, next) {
  res.render('homework_check', {
    user: User,
    courses : Courses
  });
});

router.get('/homework_statistic', function (req, res, next) {
  res.render('homework_statistic', {
    user: User,
    courses : Courses
  });
});

router.get('/course_class', function (req, res, next) {
  res.render('course_class', {
    user: User,
    courses : Courses
  });
});

module.exports = router;
